﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using DevExpress.XtraEditors;
using DTD2013.Common;

namespace DTD2013.MainApp.UI
{
    public partial class guiConfirmPassword : XtraForm
    {
        private string Password = string.Empty;

        public guiConfirmPassword()
        {
            InitializeComponent();
        }

        public guiConfirmPassword(string passWord)
        {
            InitializeComponent();
            Password = passWord;
        }

        private void txtConfirmPassword_KeyUp(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.Enter)
            {
                if (txtConfirmPassword.Text == Password)
                {
                    errorPasswordNotMatch.ClearErrors();
                    DialogResult = DialogResult.OK;
                    this.Close();
                }
                else
                {
                    errorPasswordNotMatch.SetError(txtConfirmPassword, MessageResource.PASSWORD_NOT_MATCH);
                }
            }
        }
    }
}
